<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Session;

/**
 * @descr   作用:测试的类
 * @author  liuguansheng
 * Class test
 * @package App\Http\Controllers
 */
class test extends Controller
{
	public function index()
	{
		$discount = DB::table('score')->get()->toArray();
		dd($discount[0]->relation);
	}

	public function care(Request $request)
	{
		
//		Session::flush();
		var_dump(Redis::hgetall('hotData'));
		var_dump(json_decode(Redis::hget('hotData','hotData:3')));
	}

	public function addUserInfoToSession()
	{
		$userInfo = DB::table('home_users')->where('id','1')->get()->toArray();
		//dd($userInfo);
		Session::put('home_user',$userInfo);
		var_dump(Session::get('home_user')[0]);
	}
}
